Skip to content
This repository has been archived by the owner on Dec 31, 2020. It is now read-only.

Warnings on setting propTypes, defaultProps and contextTypes of MobxStoreInjector #88

Closed
wants to merge 2 commits into from
Closed

Warnings on setting propTypes, defaultProps and contextTypes of MobxStoreInjector #88

wants to merge 2 commits into from

Conversation

jtraub
Copy link
Contributor

@jtraub jtraub commented Jul 19, 2016

The code throws warnings when user tries to attach propTypes, defaultProps and contextTypes to MobxStoreInjector instead of wrapped component. See #70 and #84.

@jtraub jtraub closed this Aug 1, 2016
@mweststrate
Copy link
Member

@jtraub specific reason to close this one?

@jtraub
Copy link
Contributor Author

jtraub commented Aug 1, 2016

@mweststrate I saw you rewrote the code so the PR had merge conflicts. I thought it would be easier to manually reimplement if you still need this

@@ -302,6 +302,25 @@
});
Injector.contextTypes = { mobxStores: PropTypes.object };
Injector.wrappedComponent = component;

if (process.env.NODE_ENV !== 'production') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can throw error if process is not defined

@mweststrate
Copy link
Member

yep, seems useful, I'll open issue just to not forget :)

@mweststrate
Copy link
Member

@jtraub merged it nonetheless :) thanks for the contribution!

mweststrate referenced this pull request Nov 10, 2016
This change forward writes (but not reads!) of `propTypes` and `defaultProps` on an inject based HoC to the wrapped component, so that propTypes and defaultProps can be defined in a straight forward way.
@github-actions github-actions bot mentioned this pull request Oct 13, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants